<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--<!DOCTYPE html>-->
<html xmlns:ng="http://angularjs.org" id="ng-app" ng-app="ubang">
<head>
    <!--[if lte IE 8]>
    <script>
        document.createElement('ng-include');
        document.createElement('ng-pluralize');
        document.createElement('ng-view');

        // Optionally these for CSS
        document.createElement('ng:include');
        document.createElement('ng:pluralize');
        document.createElement('ng:view');
    </script>
    <![endif]-->
    <title></title>
    <meta charset="utf-8">
    <link href="/res/plugin/bootstrap/css/bootstrap.css" rel="stylesheet">
    <link href="/res/plugin/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
    <link href="/ubang/res/css/main.css" rel="stylesheet">
    <script type="text/javascript" src="/res/plugin/jquery/jquery-1.10.1.js"></script>

    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
    <script src="/res/plugin/gmaps/gmaps.js"></script>

    <script type="text/javascript" src="/res/plugin/bootstrap/js/bootstrap.js"></script>
    <script type="text/javascript" src="/res/plugin/underscore/underscore-min.js"></script>
    <script type="text/javascript" src="/res/plugin/angular/angular.min.js"></script>
    <script type="text/javascript" src="/res/plugin/json2.js"></script>
    <style>
        .label-content:hover {
            text-decoration: underline;
            color: blue;
        }

        .text-red {
            color: red;
        }
    </style>
</head>
<body ng-controller="AllDocCrtl">
<div ng-show="!pageData" style="padding: 20px;">
    数据加据中...
</div>
<div class="u_child_box" ng-show="pageData">
    <div class="u_title_bar">
        <span id="device_info" class="u_title">设备管理</span>
    </div>

    <div class="u_c_header ">
        <div class="u_c_m_h">
            <form class="form-inline">
                <div class="pull-left">
                    <label>设备查询</label>


                    <input type="text" ng-model="word" placeholder="搜索：别名、IMEI、品牌、型号" class="search-query"
                           id="searchFiled">
                    每页设备数：
                    <select ng-model="queryParams.pageSize" class="span1">
                        <option>10</option>
                        <option>15</option>
                        <option>20</option>
                        <option>50</option>
                        <option>100</option>
                        <option>500</option>
                        <option>1000</option>
                    </select>


                    <button class="btn u_c_btn" ng-click="search()">
                        <i class="icon-search"></i> 查询
                    </button>

                </div>
                <div class="pull-right">
                    <label class="radio" ng-click="setTableData(pageItems.all)">
                        <input type="radio" checked name="isOnline" value="2">全部
                    </label>
                    <label class="radio" ng-click="setTableData(pageItems.online)">
                        <input type="radio" name="isOnline" value="1">在线
                    </label>
                    <label class="radio" style="margin-right: 20px;" ng-click="setTableData(pageItems.offline)">
                        <input type="radio" name="isOnline" value="0">离线
                    </label>
                    <a class="btn u_c_btn" href="./list.html">
                        <i class="icon-share"></i>
                        刷新
                    </a>
                </div>
            </form>


        </div>
    </div>


    <table class="table table-striped table-bordered table-condensed dataListTable" style="margin-bottom: 10px;">
        <thead>
        <tr>
            <th class="gray">#</th>
            <th><input ng-checked="pageData.ckAll" ng-click="CheckController.ckAllItems(pageData)" type="checkbox"></th>
            <!--<th>名称</th>-->
            <th>状态</th>
            <th style="text-align: center;">设备标签</th>

            <th>IMEI</th>
            <th>设备类型</th>
            <th>操作系统</th>

            <th>品牌</th>
            <th>型号</th>
            <th>锁屏</th>
            <th>激活</th>

            <th style="width: 120px">注册时间</th>
            <th style="text-align: center;">设备日志</th>
            <th style="text-align: center;">应用列表</th>
        </tr>
        </thead>
        <tbody ng-show="pageData.items.length">
        <tr ng-repeat="item in pageData.items">
            <td class="gray">{{$index+1}}</td>
            <td>
                <input ng-disabled="!item.conn" type="checkbox" ng-checked="item.checked"
                       ng-click="CheckController.ckItem(item,pageData)"
                       value="{{$index}}">
            </td>
            <!--<td><i class="icon-signal {{item.show_conn}}"></i> <strong>{{item.show_name}}</strong></td>-->
            <td style="color: {{item.online_c}};">{{item.online_show}}</td>
            <td ng-click="setLabel(item)" class="label-content" style="cursor: pointer; text-align: center;" title="单击设置设备标签">
                {{item.language}}
            </td>
            <td>{{item.imei}}</td>
            <td>{{item.deviceType}}</td>
            <td>{{item.os}} {{item.osVersion}}</td>
            <td>{{item.brand}}</td>
            <td>{{item.model}}</td>
            <td class="text-red">{{item.isLock}}</td>
            <td class="text-red">{{item.isActive_show}}</td>

            <td>{{item.createTime_show}}</td>
            <td style="text-align: center;">
                <a href="#" ng-click="showLogs(item)">
                    <i class="icon-eye-open"></i>
                    查看
                </a>
            </td>
            <td style="text-align: center;">
                <a href="#" ng-click="showApps(item)">
                    <i class="icon-chevron-down"></i>
                    展开
                </a>
            </td>
        </tr>
        </tbody>
        <tr ng-show="!pageData.items.length">
            <td colspan="11">暂无数据...</td>
        </tr>
    </table>

    <div class="footer_bar">
        <div class="pull-left">
            第<span class="num">{{pageData.pageNo}}</span>页，
            共<span class="num">{{pageData.totalPage}}</span>页，
            共<span class="num">{{pageData.totalNum}}</span>条数据
        </div>
        <div class="pagination pull-right">
            <ul>
                <li class="{{pageData.pageObj.first}}">
                    <a href="javascript:void(0)" ng-click="goPage(1,pageData.pageObj.first)">&lt;&lt;</a>
                </li>
                <li class="{{pageData.pageObj.prev}}">
                    <a href="javascript:void(0)" ng-click="goPage(pageData.pageNo-1,pageData.pageObj.prev)">&lt;</a>
                </li>
                <li ng-repeat="pageItem in pageData.pageObj.items" class="{{pageItem.className}}">
                    <a href="javascript:void(0)"
                       ng-click="goPage(pageItem.index,pageItem.className)">{{pageItem.index}}</a>
                </li>
                <li class="{{pageData.pageObj.next}}">
                    <a href="javascript:void(0)" ng-click="goPage(pageData.pageNo+1,pageData.pageObj.next)">&gt;</a>
                </li>
                <li class="{{pageData.pageObj.end}}">
                    <a href="javascript:void(0)" ng-click="goPage(pageData.totalPage,pageData.pageObj.end)">
                        &gt;&gt;</a>
                </li>
            </ul>
        </div>
    </div>
</div>
<div class="u_c_header ">
    <div class="u_c_m_h">
        <form class="form-inline">
            <div class="pull-left" style="padding: 8px;">
                <div class="btn-group">
                    <button class="btn  btn-info" ng-click="AndroidCtroller.lockScreen()"
                            ng-disabled="AndroidCtroller.disabled">
                        <i class="icon-lock"></i>
                        锁屏
                    </button>
                    <button class="btn  btn-info" ng-click="AndroidCtroller.unlock()"
                            ng-disabled="AndroidCtroller.disabled">
                        <i class="icon-trash"></i>
                        解锁
                    </button>
                    <button class="btn  btn-info" ng-click="AndroidCtroller.warnBell()"
                            ng-disabled="AndroidCtroller.disabled">
                        <i class="icon-bell"></i>
                        报警
                    </button>
                    <button class="btn btn-info" ng-click="AndroidCtroller.clearSDData()"
                            ng-disabled="AndroidCtroller.disabled">
                        <i class="icon-remove-sign"></i>
                        擦除SD卡数据
                    </button>
                    <button class="btn  btn-info" ng-click="AndroidCtroller.restore()"
                            ng-disabled="AndroidCtroller.disabled">
                        <i class="icon-share"></i>
                        恢复出厂设置
                    </button>
                    <button class="btn  btn-info" ng-click="AndroidCtroller.location()"
                            ng-disabled="AndroidCtroller.disabled">
                        <i class="icon-map-marker"></i>
                        远程定位
                    </button>
                    <button class="btn  btn-info" ng-click="AndroidCtroller.network()"
                            ng-disabled="AndroidCtroller.disabled">
                        <i class="icon-cog"></i>
                        网络控制
                    </button>
                </div>
            </div>
            <div class="pull-right" style="padding: 8px;">
                <button class="btn btn-info" type="button" ng-click="sendMsg()" ng-disabled="AndroidCtroller.disabled">
                    <i class="icon-envelope"></i>
                    发送消息
                </button>
            </div>

        </form>

    </div>
</div>
<div id="msgModal" data-backdrop="false"
     style="border: none; width: 60%; margin-left: -30%;top:50%;margin-top: -20%;"
     class="modal hide fade"
     role="dialog"
     aria-labelledby="commonModalLabel" aria-hidden="true">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h5 title>推送文本消息</h5>
    </div>
    <div class="modal-body" style="max-height: 100%; ">

        <div style="margin-bottom: 15px;">
            <input type="text" ng-model="msg.title" maxlength="30" style="width: 95%;" placeholder="请输入30字之内的标题"/>
        </div>

        <textarea maxlength="250" ng-model="msg.content" style="width: 95%;height:150px;"
                  placeholder="请输入250字之内的内容"></textarea>
    </div>
    <div class="modal-footer">
        <a href="#" class="btn btn-info" ng-click="AndroidCtroller.sendMsg(msg)">发 送</a>
        <a href="#" class="btn btn-info" data-dismiss="modal" aria-hidden="true">关 闭</a>
    </div>
</div>

<script src="/res/js/common.js" type="text/javascript"></script>
<script src="/isys/res/js/i_common.js" type="text/javascript"></script>
<script src="./list.js" type="text/javascript"></script>
</body>
</html>